package cn.stylefeng.guns.modular.gd.controller;

import cn.stylefeng.guns.modular.gd.entity.GdTools;
import cn.stylefeng.guns.modular.gd.service.GdToolsService;
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author:陈琳琳
 */
@RestController
@ApiResource(name="供电基础信息管理",path = "/api/gd/")
public class GdController {
    @Resource
    GdToolsService service;
    @GetResource(name="信息列表",path = "list")
    ResponseData list(){
        return service.getList();
    }
    @GetResource(name="信息名字列表",path = "names")
    ResponseData names(){
        return service.getNames();
    }
    @GetResource(name="查询根据名字",path = "where")
    ResponseData byName(String name){
        return service.name(name);
    }
    @PostResource(name="新增",path = "add")
    ResponseData add(@RequestBody GdTools tools){
        return service.add(tools);
    }
    @PostResource(name="修改",path = "update")
    ResponseData update(@RequestBody GdTools tools){
        return service.update(tools);
    }
}
